import base from './base'; // 导入接口域名列表
import axios from './http'; // 导入http中创建的axios实例
const apiUrl = base.test;
// 导出接口
export default {
  // 获取商品分类
  getGoodsClass () {
	return axios.get(`${apiUrl}/category/goodsCategory/apppublicapi/list`);
  },
  // 获取商品分页列表
  getGoodsList (params) { // pageNo， pageSize catId: 商品分类id
	return axios.get(`${apiUrl}/goodsbaseinfo/goodsBaseInfo/apppublicapi/getGoodsPageListByCatId`, {
		params
	})
  },
  //获取商品详情
  getGoodsDetail (goodsId) {
    return axios.get(`${apiUrl}/goodsbaseinfo/goodsBaseInfo/apppublicapi/getGoodsBaseInfoById/${goodsId}`);
  },
  
  // 根据商品的ID获得商品的正文部分
  getGoodsDes (goodsId) {
    return axios.get(`${apiUrl}/goodsbaseinfo/goodsBaseInfo/apppublicapi/getGoodsDescById/${goodsId}`);
  },
  
  // 获取文章详情
  getArticleDetail(articleId) {
	return axios.get(`${apiUrl}/goodsarticle/goodsArticle/apppublicapi/getGoodsArticleDetailById/${articleId}`);  
  },
  // 根据关键词查询相应到产品列表
  searchWord (keyword) {
    return axios.get(`${apiUrl}/goodsbaseinfo/goodsBaseInfo/apppublicapi/keyWordQuery?keyword=${keyword}`);
  },
  
}

